package com.foreveross.fetl.core.domain.single.repository;

import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

import com.foreveross.fetl.core.domain.single.SinglePlaneInfoEntity;

public interface ISinglePlaneInfoRepository {
	
	/**
	 * 保存 planeInfo
	 * @param entity
	 * @throws SQLException
	 */
	public void create(SinglePlaneInfoEntity entity) throws SQLException;
	
	public void create(Collection<SinglePlaneInfoEntity> set)throws SQLException;
	
	public void update(SinglePlaneInfoEntity entity);
	
	/**
	 * 删除planeInfo 
	 * @param entity
	 * @throws SQLException
	 */
	public void delete(SinglePlaneInfoEntity entity) throws SQLException;
	
	public void delete(Collection<SinglePlaneInfoEntity> oldList) throws SQLException;
	
	/**
	 * 根据条件删除
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightDate
	 * @param flightNo
	 */
	public void delete(String hbaseKey,String fromCity,String toCity,String flightDate,String flightNo)throws SQLException;
	
	/**
	 * 查planeInfo的信息
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param flightNo
	 * @return
	 * @throws SQLException
	 */
	public List<SinglePlaneInfoEntity> findByCondition(String hbaseKey,String fromCity,String toCity,String flightBatchDate,String flightNo) throws SQLException;
	
	/**
	 * 查询 planInfo  只返回 planeInfo 的主属性 
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param flightNo
	 * @param grabDate
	 * @return
	 */
	public List<SinglePlaneInfoEntity> findPlaneInfoProperty(String hbaseKey,String carrierKey,
			String fromCity, String toCity, String flightBatchDate,String flightNo,String grabDate);
	
	/**
	 * 返回全部属性
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param flightBatchDate
	 * @param flightNo
	 * @return
	 */
	public List<SinglePlaneInfoEntity> findPlanInfoAndFamily(String hbaseKey,
			String fromCity, String toCity, String flightBatchDate,String flightNo);
	
	
	
	public void deleteFormPlaneDay(SinglePlaneInfoEntity entity) throws SQLException;
	
	public void creatToPlaneDay(SinglePlaneInfoEntity entity) throws SQLException;
	
	public List<SinglePlaneInfoEntity> findFromPlaneDay(String hbaseKey,
			String fromCity, String toCity, String flightBatchDate) throws SQLException;
	
	/**
	 * 查询一小时内的数据
	 * @param hbaseKey
	 * @param fromCity
	 * @param toCity
	 * @param grabDate String yyyyMMddHH 2014032721
	 * @return
	 */
	public List<SinglePlaneInfoEntity> findByGrabDate(String hbaseKey,
			String fromCity, String toCity,String grabDate);

}
